<template>
  <div class="project_detail">
    <div class="top">
      <van-nav-bar :title="project_name"
                   left-text="返回"
                   left-arrow
                   @click-left="onClickLeft(4)" />
    </div>
    <!--<h1>{{ project_name }}</h1>-->
    <div class="project_content">
      <van-card v-for="(item , index) in product_list"
                :key="index"
                :tag="project_name"
                :price="item.price"
                :desc="item.desc"
                :title="item.name"
                :thumb="getUIR(item.img)"
                :origin-price="item.origin_price" />

    </div>

  </div>
</template>

<script>
export default {
  name: "ProjectDetail",
  data () {
    return {
      project_name: '',
      product_list: [
        {
          name: "粉色花海",
          img: "/profile/upload/粉色花海.png",
          price: "1999￥",
          origin_price: "9999￥",
          desc: "HelloWorld~~~HelloWorld~~~"

        },
        {
          name: "爱的另一端",
          img: "/profile/upload/爱的另一端.png",
          price: "1959￥",
          origin_price: "9999￥",
          desc: "塔塔开~塔塔开"
        },
        {
          name: "守护",
          img: "/profile/upload/守护.png",
          price: "5999￥",
          origin_price: "9999￥",
          desc: "塔塔开~塔塔开~"
        },
        {
          name: "挚爱",
          img: "/profile/upload/挚爱.png",
          price: "7999￥",
          origin_price: "9999￥",
          desc: "米卡萨~米卡萨~"
        },
      ]
    }
  },
  methods: {
    onClickLeft (index) {
      this.$router.push({ name: 'home', params: index })
    },
    getUIR (img) {

      // http://localhost:8848/ChallengeCup/profile/upload/%E7%B2%89%E8%89%B2%E8%8A%B1%E6%B5%B7.png
      // return "http://localhost:8848/ChallengeCup" + img
      return "http://localhost:8848/ChallengeCup" + img
    }
  },
  created () {
    this.project_name = this.$route.params.project_name
  }
}
</script>

<style scoped lang="less">
.top {
  position: fixed;
  top: 0;
  width: 100%;
  background-color: #fff; // 如果需要背景颜色，请根据您的设计添加颜色值
  z-index: 1000; // 根据需要调整 z-index 值
}
.project_content {
  padding-top: 48px;
}
</style>
